package com.hk.controller;


import com.hk.enums.ContentTypeEnum;
import com.hk.service.business.parser.AbstractParser;
import com.hk.service.business.parser.ParserBusiness;
import com.hk.service.business.parser.ParserBusinessFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Objects;

@RestController
@RequestMapping("factory")
public class FactoryController {

    @Autowired(required = false)
    private ParserBusiness parserBusiness;



    @GetMapping("queryType")
    public void getType(ContentTypeEnum type) {
        parserBusiness.parserByType(type);
    }

    @GetMapping("factoryTest")
    public void factoryTest(String type) {
        AbstractParser parser = ParserBusinessFactory.parserService(type);
        parser.parse("");
    }


    @GetMapping("syncData")
    public void syncData() {


    }

}
